<!DOCTYPE html>
<html>
    <head>
        {include file='public/meta'/}
        <link rel="stylesheet" href="/assets/merchant/css/bootstrapSwitch.css">

        <link rel="stylesheet" href="/assets/merchant/css/addmchat.css"/>

        <script src="/assets/merchant/js/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
        <script src="/assets/merchant/js/liandong.js" type="text/javascript" charset="utf-8"></script>
        <style>
            .filePicker{
                margin-top: -5px;
                width: 150px;
                height: 44px;
                background: #00A2D4;
                color: #fff;
                text-align: center;
                line-height: 44px;
                border-radius: 4px;
                cursor: pointer;
            }
            .file{
                position: absolute;
                left: 14px;
                top: -5px;
                width: 150px;
                height: 44px;
                line-height: 44px;
                opacity: 0;
                cursor: pointer;
            }
            .img-file{
                width: 100px;
                height: 100px;
                display: block;
                margin-left: 26px;
                margin-top: 10px;
                display: none;
            }
            .form-control{
                width: 50%;
            }
        </style>
    </head>
    <body onload="init()">
    {include file='public/header'/}
    <!------------------导航-------------------------->
    <section>
        {include file='public/left'/}
        <!--------------------------主要内容区域------------------------------------->
        <div class="content">
            <div class="page-heading">
                <ul class="breadcrumb">
                    <li>
                       当前位置是&nbsp;:&nbsp;商户管理
                    </li>
                    <li class="active" style="color: #02b87f;"> 卡券商户</li>
                </ul>
            </div>
            <div class="panel mgr15 mgl15">
                <div class="panel-heading addCharts" style="background:#ededed;">
                    修改卡券商户
                </div>
                <div class="panel-body">
                    <div class="col-md-3">
                        <div class="">
                            <ul id="myTab" class="nav nav-pills nav-stacked" role="tablist">
                                <li role="presentation" class="active"><a href="#base" role="tab" data-toggle="tab" aria-controls="base">基本信息</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-md-9">
                    <form class="form-horizontal adminex-form" action='' method="post">
                        <input type="hidden" name="mid" value="{$info.mid}">
                <div class="tab-content">
                    <!--基础字段-->
                    <div role="tabpanel" class="panel-body tab-pane active" id="base" aria-labelledBy="base-tab">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">商户名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control col-sm-6 col-xs-7" name='business_name' value="{$info.business_name}" placeholder="">
                                <div class="error"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">卡券LOGO</label>
                            <div class="col-sm-10">
                                <input type="file" id="val-file1" name="file" class="file" onchange="upload('val-file1','logo_url')"/>
                                <div class="filePicker" id="file1">选择卡券LOGO</div>
                                <img src="" class="val-file1 img-file"/>
                                <input type="hidden" name="logo_url" class="file-val-file1" value="" />

                                <div class="error"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">门店地址</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control col-sm-6 col-xs-7" name='address' value="{$info.address}" placeholder="">
                                <div class="error"></div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">门店的电话</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control col-sm-6 col-xs-7" name='telephone' value="{$info.telephone}" placeholder="">
                                <div class="error"></div>
                            </div>
                        </div>


                    </div>
                    <!--自定义字段-->

                        <div style="text-align: center">
                            <button type="submit" class="btn btn-primary">添加</button>
                        </div>

                </div>
                    </form>
                    </div>
                </div>
            </div>
            {include file='public/footer'/}
        </div>
    </section>
</body>
    <script src="__PUBLIC__/Admin/js/bootstrapSwitch.js"></script>
    <script src="__PUBLIC__/Admin/js/commen.js" type="text/javascript" charset="utf-8"></script>

    <script type="text/javascript">
        function upload(file,typed) {
            var formData = new FormData();
            formData.append('file', $('#' + file)[0].files[0]);
            formData.append('other',file);

            $.ajax({
                url: "{:url('Upload/uploadfile')}",
                type: 'POST',
                cache: false,
                data: formData,
                processData: false,
                contentType: false,
            }).done(function (res) {
                $("." + file).attr("src", res.savapath).css("display", "block");
                $(".file-"+file).val(res.other);
                $("."+typed+"-"+file).val(res.other);
            }).fail(function (res) {
                alert("上传失败")
            });
        }
    </script>


</html>
